from django.urls import re_path
from rest_framework.routers import DefaultRouter, SimpleRouter

from article.views import *

urlpatterns = [
    # 文章- 获取所有频道
    re_path(r'^channels/$', ChannelsView.as_view({'get': 'list', })),
    # 所有标签列表
    re_path(r'^labels/$', LabelsView.as_view({"get": "list", })),
]

router = SimpleRouter()
# 文章操作
router.register(r'article', ArticleCreatView, basename='article')
# 搜索
router.register('articles/search', MySearchView, base_name='articles/search')
urlpatterns += router.urls
